package im.xz.cn.xiacore.menu.playerInfoMenu;

import im.xz.cn.xiacore.methods.playerHead;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import im.xz.cn.xiacore.methods.itemStack;
import im.xz.cn.xiacore.methods.rank;
import im.xz.cn.xiacore.apis.vault.vault;
import java.util.ArrayList;
public class playerMenu  {
    public static void playerMenu_qwq(Player player) {
        ItemStack head = playerHead.getHead(player,1,false,player.getName(),"无法取得rank信息","请联系管理员","错误代码8217");
        int rankLevel = rank.getRank(player);
        try {
            if (rankLevel == 0) {
                head = playerHead.getHead(player,1,false,ChatColor.GRAY + player.getName(),ChatColor.WHITE + "欢迎！亲爱的" + player.getName(),ChatColor.WHITE + "","");
            }else if (rankLevel == 1) {
                head = playerHead.getHead(player,1,false,ChatColor.GREEN + "[VIP]" + player.getName(),ChatColor.WHITE + "欢迎！亲爱的" + player.getName(),ChatColor.WHITE + "",ChatColor.GREEN + "您是高贵的铁卡用户");
            }else if (rankLevel == 2) {
                head = playerHead.getHead(player,1,false,ChatColor.GREEN + "[VIP+]" + player.getName(),ChatColor.WHITE + "欢迎！亲爱的" + player.getName(),ChatColor.WHITE + "",ChatColor.GREEN + "您是高贵的金卡用户");
            }else if (rankLevel == 3) {
                head = playerHead.getHead(player,1,false,ChatColor.AQUA + "[MVP]" + player.getName(),ChatColor.WHITE + "欢迎！亲爱的" + player.getName(),ChatColor.WHITE + "",ChatColor.AQUA + "您是高贵的钻石卡用户");
            }else if (rankLevel == 4) {
                head = playerHead.getHead(player,1,false,ChatColor.AQUA + "[MVP+]" + player.getName(),ChatColor.WHITE + "欢迎！亲爱的" + player.getName(),ChatColor.WHITE + "",ChatColor.AQUA + "您是尊贵的Premium用户");
            }else if (rankLevel == 621) {
                head = playerHead.getHead(player,1,true,ChatColor.LIGHT_PURPLE + "[Gemini]" + player.getName(),ChatColor.WHITE + "欢迎！亲爱的" + player.getName(),ChatColor.WHITE + "",ChatColor.LIGHT_PURPLE + "您是Gemini");
            }
        }catch (NullPointerException ignore) {
        }
        ItemStack back = new ItemStack(Material.BARRIER);
        ItemMeta backMeta = back.getItemMeta();
        backMeta.setDisplayName(ChatColor.RED + "返回上一页");
        back.setItemMeta(backMeta);
        ItemStack rank = itemStack.createItemStack(Material.BARRIER,ChatColor.RED + "ERROR",ChatColor.WHITE + "请联系管理员","","",1,false);
        try {
            if (rankLevel == 0) {
                rank = itemStack.createItemStack(Material.DIRT, ChatColor.GRAY + "默认等级", ChatColor.WHITE + "您是默认等级玩家", ChatColor.WHITE + "了解更多或升级?", ChatColor.WHITE + "访问我们的论坛!", 1,false);
            }else if (rankLevel == 1) {
                rank = itemStack.createItemStack(Material.IRON_INGOT,ChatColor.GREEN + "[VIP]您是铁卡用户",ChatColor.WHITE + "您是高贵的铁卡用户！",ChatColor.WHITE + "了解更多或升级?",ChatColor.WHITE + "访问我们的论坛!",1,false);
            }else if (rankLevel == 2) {
                rank = itemStack.createItemStack(Material.GOLD_INGOT,ChatColor.GREEN + "[VIP+]您是金卡用户",ChatColor.WHITE + "您是高贵的金卡用户！",ChatColor.WHITE + "了解更多或升级?",ChatColor.WHITE + "访问我们的论坛!",1,false);
            }else if (rankLevel == 3) {
                rank = itemStack.createItemStack(Material.DIAMOND,ChatColor.AQUA + "[MVP]您是钻石卡用户",ChatColor.WHITE + "您是高贵的钻石卡用户！",ChatColor.WHITE + "了解更多或升级?",ChatColor.WHITE + "访问我们的论坛!",1,false);
            }else if (rankLevel == 4) {
                rank = itemStack.createItemStack(Material.ENCHANTED_GOLDEN_APPLE,ChatColor.AQUA + "[MVP+]您是Premium用户",ChatColor.WHITE + "您是尊贵的Premium用户！",ChatColor.WHITE + "了解更多或升级?",ChatColor.WHITE + "访问我们的论坛!",1,true);
            }else if (rankLevel == 621) {
                rank = itemStack.createItemStack(Material.REPEATING_COMMAND_BLOCK,ChatColor.LIGHT_PURPLE + "[Gemini]您是Gemini",ChatColor.WHITE + "您是Gemini",ChatColor.WHITE + "",ChatColor.WHITE + "",1,true);
            }
        }catch (NullPointerException ignore) {
        }
        ItemStack info = itemStack.createItemStack(Material.END_CRYSTAL,ChatColor.RED + "你的资料",ChatColor.WHITE + "硬币: " + ChatColor.GRAY + vault.getEconomy(player),ChatColor.WHITE + "星尘: " + ChatColor.LIGHT_PURPLE + "0",ChatColor.WHITE + "等级: " + ChatColor.GRAY + player.getLevel(),1,false);
        Inventory playerMenu = Bukkit.createInventory(player,27, ChatColor.LIGHT_PURPLE + "繁星梦 - 玩家菜单");
        playerMenu.setItem(10,head);
        playerMenu.setItem(18,back);
        playerMenu.setItem(12,rank);
        playerMenu.setItem(14,info);
        player.openInventory(playerMenu);
    }
}